Skip to content

Pattern quality: Replace unactionable code-improvement tip with scoping guidance - #258

Merged
pelikhan merged 1 commit into
mainfrom
fix/code-improvement-tip-actionable-59babc9858c0a047
Sep 5, 2026
Merged

Pattern quality: Replace unactionable code-improvement tip with scoping guidance#258
pelikhan merged 1 commit into
mainfrom
fix/code-improvement-tip-actionable-59babc9858c0a047

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Evaluated the wizard's generated pattern/prompt samples in /tmp/gh-aw/data/generated-patterns-and-prompts.json across all six archetypes (status-report, issue-triage, code-improvement, documentation-updater, dependency-monitor, pr-review) against patterns/manifest.json, patterns/workflow-generation.json, and the archetype files, plus the generator logic in src/js/workflow.js.

Recurring quality issue found

The code-improvement archetype's tips array included:

"Avoid pr-fix and ci-doctor templates — both have <20% success in practice"

generateAgentPrompt in src/js/workflow.js surfaces every archetype tip verbatim as a "Follow the workflow-specific guidance" bullet in the prompt sent to the downstream agent (confirmed in the code-improvement-daily sample). pr-fix and ci-doctor are internal workflow names from the underlying scan dataset (data/analysis-report.json's new_patterns/degraded_workflows) — they aren't concepts exposed in the wizard UI, the generator code, or any other pattern file. A downstream agent asked to create a brand-new workflow from scratch has no workflow named pr-fix or ci-doctor to "avoid," so this instruction is unactionable noise rather than guidance, and risks confusing the agent into thinking it should check for/rename away from those literal names.

What changed

Replaced the tip with the actionable lesson those two degraded patterns actually illustrate — that broad, unscoped "fix anything broken" code-improvement workflows have the lowest success rates — so the generated prompt gives the downstream agent something it can act on (scope each run to one narrow, well-defined improvement) instead of an opaque template name.

Files touched:

  • patterns/archetypes/code-improvement.json (generated pattern data)
  • scripts/generate-patterns.py (source of truth so the fix survives the next npm run generate-patterns / weekly scan regeneration)

Validation

  • npm test — 319 passed (18 test files), no failures. The only non-test-related error is a pre-existing CI artifact-write warning (step_summary_... ENOENT) unrelated to this change.
  • npm run build — succeeded, dist/patterns/archetypes/code-improvement.json rebuilt with the new tip.

Follow-up ideas deliberately left out

  • Broader audit of whether other archetype tips reference internal-only names (none found in this pass, but not exhaustively fuzzed).
  • Considering a lint/test rule that flags tips containing template/workflow-like slugs (e.g. \b[a-z]+-[a-z]+\b with no wizard-facing referent) to catch this class of issue automatically — left out to keep this change minimal and avoid new tooling.

Generated by Pattern Quality Eval · copilot · auto · 81.7 AIC · ⌖ 11.6 AIC · ⊞ 7.8K ·

The code-improvement archetype tip referenced internal scan-data
workflow names (pr-fix, ci-doctor) that aren't exposed anywhere in the
wizard UI or generator. Downstream agents building a new workflow from
this generated prompt have no way to act on 'avoid these templates' —
it's noise, not guidance. Replaced with the underlying, actionable
lesson: scope each code-improvement run to one narrow, well-defined
fix rather than an open-ended mandate, which is what the low success
rate of those degraded workflows actually reflects.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review September 5, 2026 00:47
Copilot AI lite review requested due to automatic review settings September 5, 2026 00:47
@pelikhan
pelikhan merged commit 63d2811 into main Sep 5, 2026
4 of 7 checks passed
@pelikhan
pelikhan deleted the fix/code-improvement-tip-actionable-59babc9858c0a047 branch September 5, 2026 00:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are a straightforward, consistent replacement of an unactionable tip in both the generator and generated output, with no detected functional or structural issues.

Pull request overview

This PR improves the quality of the wizard’s generated prompts by replacing an unactionable code-improvement archetype tip (referencing internal-only workflow/template names) with concrete scoping guidance that a downstream agent can actually follow.

Changes:

  • Replaced the code-improvement archetype tip to emphasize narrowly scoped, well-defined improvements rather than “fix anything broken”.
  • Updated the source-of-truth generator (scripts/generate-patterns.py) so the change persists across future pattern regenerations.
  • Regenerated the corresponding generated archetype data (patterns/archetypes/code-improvement.json) to reflect the updated tip.
File summaries
File Description
scripts/generate-patterns.py Updates the generated archetype configuration for code-improvement to use actionable scoping guidance in tips.
patterns/archetypes/code-improvement.json Updates the generated archetype JSON tip string to match the new scoping guidance.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants